import React, { useEffect, useState } from 'react'
import { hotReq } from '../service/index'
/**
 *  1.数据请求,数据赋值,数据渲染
 */

export default function Hello () {
  const [list, setList] = useState({})
  useEffect(() => {
    async function getData () {
      const { status, data: { data: { content } } } = await hotReq()
      setList(content)
    }
    getData()
  }, [])
  return (
    <div>
      {list[0] && list.map(item => <li key={item.id} >{item.d_title}</li>)}
    </div>
  )
}
